package com.zhongkai.model3;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Objects;

@Entity
@Table(name = "chinaset" )
public class Chinaset implements Serializable {
    private Integer id;
    private String uuid;
    private String userName;
    private String passWord;
    private String setName;
    private String setSex;
    private String setPhone;
    private Integer setRole;
    private String token;

    private ArrayList<MenusRole> menusRoles;

    public ArrayList<MenusRole> getMenusRoles() {
        return menusRoles;
    }

    public void setMenusRoles(ArrayList<MenusRole> menusRoles) {
        this.menusRoles = menusRoles;
    }

    @Basic
    @Column(name = "token")
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Id
    @GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "uuid")
    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "pass_word")
    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    @Basic
    @Column(name = "set_name")
    public String getSetName() {
        return setName;
    }

    public void setSetName(String setName) {
        this.setName = setName;
    }

    @Basic
    @Column(name = "set_sex")
    public String getSetSex() {
        return setSex;
    }

    public void setSetSex(String setSex) {
        this.setSex = setSex;
    }

    @Basic
    @Column(name = "set_phone")
    public String getSetPhone() {
        return setPhone;
    }

    public void setSetPhone(String setPhone) {
        this.setPhone = setPhone;
    }

    @Basic
    @Column(name = "set_role")
    public Integer getSetRole() {
        return setRole;
    }

    public void setSetRole(Integer setRole) {
        this.setRole = setRole;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Chinaset chinaset = (Chinaset) o;
        return Objects.equals(id, chinaset.id) &&
                Objects.equals(uuid, chinaset.uuid) &&
                Objects.equals(userName, chinaset.userName) &&
                Objects.equals(passWord, chinaset.passWord) &&
                Objects.equals(setName, chinaset.setName) &&
                Objects.equals(setSex, chinaset.setSex) &&
                Objects.equals(setPhone, chinaset.setPhone) &&
                Objects.equals(setRole, chinaset.setRole);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, uuid, userName, passWord, setName, setSex, setPhone, setRole);
    }
}
